<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>
  <title>[untitled]</title>
  <link rel="stylesheet" type="text/css" href="../../t/vim_syntax.css" />
 </head>
 <body>

<pre><span class="synPreProc">#!perl6</span>

<span class="synRepeat">for</span> <span class="synIdentifier">@foo</span> <span class="synOperator">&lt;-&gt;</span> <span class="synIdentifier">$value</span> {
}
<span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">&lt;</span><span class="synString">-</span><span class="synDelimiter">&gt;</span>(Foo) <span class="synPreCondit">is</span> <span class="synTag">required</span> {
}

<span class="synKeyword">class</span> Request { }

ok(<span class="synDelimiter">&quot;</span><span class="synString">a cat_O_9_tails</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~~</span> <span class="synDelimiter">m</span><span class="synOperator">:</span><span class="synString">s</span><span class="synDelimiter">/</span><span class="synSpecial">&lt;</span>alpha<span class="synSpecial">&gt;</span><span class="synString"> </span><span class="synSpecial">&lt;</span>ident<span class="synSpecial">&gt;</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Standard captures</span><span class="synDelimiter">'</span> )<span class="synOperator">;</span>

is <span class="synDelimiter">'</span><span class="synString">aa</span><span class="synDelimiter">'</span><span class="synOperator">.</span>trans(<span class="synDelimiter">/</span><span class="synString"> </span><span class="synSpecial">&lt;after</span> a<span class="synSpecial">&gt;</span><span class="synString"> </span><span class="synSpecialChar">.</span><span class="synDelimiter">/</span> <span class="synOperator">=&gt;</span> <span class="synDelimiter">'</span><span class="synString">b</span><span class="synDelimiter">'</span>)<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">ab</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">trans with look-around regex</span><span class="synDelimiter">'</span><span class="synOperator">;</span>
is (<span class="synDelimiter">&quot;</span><span class="synString">!</span><span class="synIdentifier">$_</span><span class="synString">!</span><span class="synDelimiter">&quot;</span> <span class="synRepeat">for</span> (<span class="synNumber">1</span><span class="synOperator">,</span> <span class="synNumber">2</span>)<span class="synOperator">&gt;&gt;.</span>trans((<span class="synNumber">1</span><span class="synOperator">..</span><span class="synNumber">26</span>) <span class="synOperator">=&gt;</span> (<span class="synNumber">14</span><span class="synOperator">..</span><span class="synNumber">26</span><span class="synOperator">,</span><span class="synNumber">1</span><span class="synOperator">..</span><span class="synNumber">13</span>)))<span class="synOperator">,</span> <span class="synDelimiter">&lt;</span><span class="synString">!14! !15!</span><span class="synDelimiter">&gt;</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">same with explicit for</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>
is <span class="synIdentifier">$s</span><span class="synOperator">.</span>trans([<span class="synDelimiter">&lt;</span><span class="synString">X Y</span><span class="synDelimiter">&gt;</span>] <span class="synOperator">=&gt;</span> [{<span class="synOperator">++</span><span class="synIdentifier">$x</span>}<span class="synOperator">,</span>{<span class="synOperator">++</span><span class="synIdentifier">$y</span>}])<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">a3b3c4d4</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">can use closures in pairs of arrays</span><span class="synDelimiter">'</span><span class="synOperator">;</span>

<span class="synKeyword">token</span> twigil<span class="synOperator">:</span><span class="synString">sym</span><span class="synDelimiter">&lt;</span><span class="synString">=</span><span class="synDelimiter">&gt;</span> {<span class="synString"> </span><span class="synSpecial">&lt;</span>sym<span class="synSpecial">&gt;</span><span class="synString"> </span>}
<span class="synIdentifier">%</span><span class="synSpecial">*</span><span class="synIdentifier">LANG</span><span class="synDelimiter">&lt;</span><span class="synString">Q</span><span class="synDelimiter">&gt;</span>       <span class="synOperator">=</span> ::STD::Q <span class="synOperator">;</span>
[<span class="synOperator">@</span>(<span class="synIdentifier">@foo</span>)]
[<span class="synIdentifier">@bar</span>]
<span class="synSpecial">when</span> <span class="synOperator">:</span>(<span class="synType">Str</span> <span class="synIdentifier">$</span> <span class="synPreCondit">where</span> <span class="synDelimiter">/</span><span class="synSpecialChar">^</span><span class="synString">The </span><span class="synSpecial">\s</span><span class="synString"> </span><span class="synSpecial">\S</span><span class="synSpecialChar">+</span><span class="synString"> </span><span class="synSpecial">\s</span><span class="synString"> </span><span class="synSpecial">\w</span><span class="synSpecialChar">+$</span><span class="synDelimiter">/</span>) { }

<span class="synIdentifier">$foo</span><span class="synOperator">.</span>state
<span class="synIdentifier">$foo</span><span class="synOperator">.</span>die
<span class="synIdentifier">@p</span> <span class="synOperator">=</span> <span class="synIdentifier">$x</span> <span class="synOperator">[[+]]=</span> <span class="synNumber">6</span><span class="synOperator">,</span> <span class="synNumber">7</span><span class="synOperator">;</span>

<span class="synIdentifier">@foo</span> <span class="synOperator">Z</span> <span class="synIdentifier">@bar</span>
is (<span class="synNumber">1</span> <span class="synOperator">R[R[R-]]</span> <span class="synNumber">2</span>)<span class="synOperator">,</span> <span class="synNumber">1</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">R[R[R-]] works</span><span class="synDelimiter">'</span><span class="synOperator">;</span>

<span class="synSpecial">my</span> <span class="synIdentifier">@seq</span> <span class="synOperator">=</span> map { <span class="synIdentifier">$_</span> <span class="synOperator">~</span> <span class="synOperator">++</span><span class="synIdentifier">$</span> }<span class="synOperator">,</span> <span class="synDelimiter">&lt;</span><span class="synString">a b c</span><span class="synDelimiter">&gt;</span><span class="synOperator">;</span>
<span class="synIdentifier">$c</span><span class="synOperator">++</span> <span class="synRepeat">for</span> <span class="synIdentifier">$@a</span><span class="synOperator">;</span>

ok <span class="synDelimiter">&quot;</span><span class="synString">a</span><span class="synDelimiter">&quot;</span> <span class="synOperator">![!eq]</span> <span class="synDelimiter">&quot;</span><span class="synString">a</span><span class="synDelimiter">&quot;</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">![!eq] is legal and works (1)</span><span class="synDelimiter">'</span><span class="synOperator">;</span>
is A<span class="synOperator">.</span>new<span class="synOperator">.</span>m<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">aaa</span><span class="synDelimiter">'</span><span class="synOperator">,</span>  <span class="synDelimiter">'</span><span class="synString">[~] works in first class</span><span class="synDelimiter">'</span><span class="synOperator">;</span>
<span class="synSpecial">my</span> <span class="synIdentifier">$l</span> <span class="synOperator">=</span> (<span class="synNumber">1</span><span class="synOperator">,</span><span class="synNumber">2</span><span class="synOperator">,</span><span class="synNumber">3</span> <span class="synOperator">Z,</span> <span class="synNumber">4</span><span class="synOperator">,</span><span class="synNumber">5</span><span class="synOperator">,</span><span class="synNumber">6</span> <span class="synOperator">Z,</span> <span class="synNumber">7</span><span class="synOperator">,</span><span class="synNumber">8</span><span class="synOperator">,</span><span class="synNumber">9</span>)<span class="synOperator">;</span>

nok <span class="synIdentifier">$mh</span> <span class="synOperator">(&lt;+)</span> <span class="synIdentifier">$m</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">Our MixHash is not a msubset of our Mix (texas)</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>
ok <span class="synIdentifier">$b</span> <span class="synOperator">(&lt;)</span> <span class="synIdentifier">$bub</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">(&lt;) - </span>{<span class="synIdentifier">$b</span><span class="synOperator">.</span>gist}<span class="synString"> is a strict submix of </span>{<span class="synIdentifier">$bub</span><span class="synOperator">.</span>gist}<span class="synString"> (texas)</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

is test_ff({<span class="synDelimiter">/</span><span class="synString">B</span><span class="synDelimiter">/</span> <span class="synOperator">fff^</span> <span class="synDelimiter">/</span><span class="synString">B</span><span class="synDelimiter">/</span> }<span class="synOperator">,</span> <span class="synDelimiter">&lt;</span><span class="synString">A B A B A</span><span class="synDelimiter">&gt;</span>)<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">xBAxx</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">/B/ fff^ /B/, lhs == rhs</span><span class="synDelimiter">'</span><span class="synOperator">;</span>

<span class="synNumber">-100</span>
is <span class="synNumber">Inf</span> <span class="synOperator">/</span> <span class="synNumber">100</span><span class="synOperator">,</span> <span class="synNumber">Inf</span><span class="synOperator">;</span>
is <span class="synNumber">Inf</span><span class="synOperator">*-</span><span class="synNumber">100</span><span class="synOperator">,</span> <span class="synNumber">-Inf</span><span class="synOperator">;</span>
is <span class="synNumber">Inf</span> <span class="synOperator">/</span> <span class="synNumber">-100</span><span class="synOperator">,</span> <span class="synNumber">-Inf</span><span class="synOperator">;</span>
is <span class="synNumber">100</span> <span class="synOperator">/</span> <span class="synNumber">Inf</span><span class="synOperator">,</span> <span class="synNumber">0</span><span class="synOperator">;</span>

<span class="synIdentifier">@definitions</span> <span class="synOperator">=</span> [<span class="synOperator">.</span>[<span class="synNumber">0</span>]<span class="synOperator">.</span>words[<span class="synNumber">0</span>]<span class="synOperator">,</span> <span class="synOperator">.</span>[<span class="synNumber">1</span>]<span class="synOperator">.</span>contents[<span class="synNumber">0</span>]]<span class="synOperator">;</span>

[[<span class="synDelimiter">'</span><span class="synString">foo</span><span class="synDelimiter">'</span>]]<span class="synOperator">;</span>

X::Foo::Bar
bag()
<span class="synType">Str</span>()

is showkv(<span class="synOperator">[(.)]</span> <span class="synIdentifier">@d</span>)<span class="synOperator">,</span> showkv(<span class="synOperator">∅</span>)<span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">Bag multiply reduce works on nothing</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

<span class="synOperator">.&gt;&gt;</span>[<span class="synNumber">0</span>]<span class="synOperator">&gt;&gt;.</span><span class="synType">Str</span><span class="synOperator">.</span>unique<span class="synOperator">;</span>

<span class="synKeyword">sub</span> process-pod-dir(<span class="synIdentifier">$dir</span><span class="synOperator">,</span> <span class="synOperator">:</span><span class="synIdentifier">&amp;sorted-by</span> <span class="synOperator">=</span> <span class="synOperator">&amp;[cmp],</span> <span class="synOperator">:</span><span class="synIdentifier">$sparse</span>) { }

<span class="synInclude">use</span> Foo::Xbar<span class="synOperator">;</span> <span class="synComment"># not a cross-operator</span>

Zfoobar<span class="synOperator">.</span>new<span class="synOperator">;</span>
<span class="synOperator">Rcmp</span>

<span class="synOperator">S|</span>

<span class="synKeyword">proto</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">«</span><span class="synString">&gt;</span><span class="synDelimiter">»</span>(<span class="synType">Any</span><span class="synOperator">,</span> <span class="synType">Any</span>) <span class="synPreCondit">returns</span> <span class="synType">Bool</span><span class="synOperator">:</span><span class="synString">D</span> <span class="synPreCondit">is</span> <span class="synTag">assoc</span><span class="synDelimiter">&lt;</span><span class="synString">chain</span><span class="synDelimiter">&gt;</span>
<span class="synKeyword">multi</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">«</span><span class="synString">&gt;</span><span class="synDelimiter">»</span>(<span class="synType">Int</span><span class="synOperator">:</span><span class="synString">D</span><span class="synOperator">,</span> <span class="synType">Int</span><span class="synOperator">:</span><span class="synString">D</span>)
<span class="synKeyword">multi</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">«</span><span class="synString">&gt;</span><span class="synDelimiter">»</span>(<span class="synType">Num</span><span class="synOperator">:</span><span class="synString">D</span><span class="synOperator">,</span> <span class="synType">Num</span><span class="synOperator">:</span><span class="synString">D</span>)
<span class="synKeyword">multi</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">«</span><span class="synString">&gt;</span><span class="synDelimiter">»</span>(<span class="synType">Real</span><span class="synOperator">:</span><span class="synString">D</span><span class="synOperator">,</span> <span class="synType">Real</span><span class="synOperator">:</span><span class="synString">D</span>)

<span class="synKeyword">proto</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">&lt;&lt;</span><span class="synString">lt</span><span class="synDelimiter">&gt;&gt;</span>(<span class="synType">Mu</span><span class="synOperator">,</span> <span class="synType">Mu</span>) <span class="synPreCondit">returns</span> <span class="synType">Bool</span><span class="synOperator">:</span><span class="synString">D</span> <span class="synPreCondit">is</span> <span class="synTag">assoc</span><span class="synDelimiter">&lt;</span><span class="synString">chain</span><span class="synDelimiter">&gt;</span>
<span class="synKeyword">multi</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">&lt;</span><span class="synString">lt</span><span class="synDelimiter">&gt;</span>(<span class="synType">Mu</span><span class="synOperator">,</span>    <span class="synType">Mu</span>)
<span class="synKeyword">multi</span> <span class="synKeyword">sub</span> infix<span class="synOperator">:</span><span class="synDelimiter">&lt;</span><span class="synString">lt</span><span class="synDelimiter">&gt;</span>(<span class="synType">Str</span><span class="synOperator">:</span><span class="synString">D</span><span class="synOperator">,</span> <span class="synType">Str</span><span class="synOperator">:</span><span class="synString">D</span>)

<span class="synSpecial">v5.2.*</span>
<span class="synSpecial">v1.2+</span>
<span class="synSpecial">v1.2.0.0.0.0.0</span>
<span class="synSpecial">v1</span>

[<span class="synNumber">1</span><span class="synOperator">,</span><span class="synNumber">2</span>] <span class="synOperator">xx</span> <span class="synNumber">3</span><span class="synOperator">;</span>

<span class="synKeyword">token</span> foo {
<span class="synString">    </span><span class="synSpecial">&lt;*</span>foo-bar<span class="synSpecial">&gt;</span>
<span class="synString">    </span><span class="synSpecial">(&lt;</span><span class="synSpecialChar">-</span><span class="synSpecial">[</span><span class="synString">:</span><span class="synSpecial">]&gt;</span><span class="synSpecialChar">*</span><span class="synSpecial">)</span>
<span class="synString">    </span><span class="synSpecial">&lt;foo=</span><span class="synSpecialChar">.</span>file<span class="synSpecial">&gt;</span>
}

<span class="synSpecial">state</span> <span class="synIdentifier">%sub-menus</span> <span class="synOperator">=</span> <span class="synIdentifier">@menu</span><span class="synOperator">&gt;&gt;.</span>key<span class="synOperator">&gt;&gt;</span>[<span class="synNumber">0</span>] <span class="synOperator">Z=&gt;</span> <span class="synIdentifier">@menu</span><span class="synOperator">&gt;&gt;.</span>value<span class="synOperator">;</span>

is( <span class="synComment"># vowels become 'y' and whitespace becomes '_'</span>
    <span class="synDelimiter">&quot;</span><span class="synString">ab</span><span class="synSpecial">\n</span><span class="synString">cd</span><span class="synSpecial">\t</span><span class="synString">ef gh</span><span class="synDelimiter">&quot;</span><span class="synOperator">.</span>trans(<span class="synDelimiter">/</span><span class="synSpecial">&lt;[</span><span class="synString">aeiou</span><span class="synSpecial">]&gt;</span><span class="synDelimiter">/</span> <span class="synOperator">=&gt;</span> <span class="synDelimiter">'</span><span class="synString">y</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">/</span><span class="synSpecial">\s</span><span class="synDelimiter">/</span> <span class="synOperator">=&gt;</span> <span class="synDelimiter">'</span><span class="synString">_</span><span class="synDelimiter">'</span>)<span class="synOperator">,</span>
    <span class="synDelimiter">'</span><span class="synString">yb_cd_yf_gh</span><span class="synDelimiter">'</span><span class="synOperator">,</span>
    <span class="synDelimiter">'</span><span class="synString">regexes pairs work</span><span class="synDelimiter">'</span><span class="synOperator">,</span>
)<span class="synOperator">;</span>

<span class="synConditional">if</span> <span class="synIdentifier">$subkinds</span> <span class="synOperator">∋</span> <span class="synDelimiter">'</span><span class="synString">method</span><span class="synDelimiter">'</span> { }

is(<span class="synDelimiter">'</span><span class="synString">ababab</span><span class="synDelimiter">'</span><span class="synOperator">.</span>trans([<span class="synDelimiter">/</span><span class="synString">ab</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">aba</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">bab</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">/</span><span class="synString">baba</span><span class="synDelimiter">/</span>] <span class="synOperator">=&gt;</span>
                   [<span class="synDelimiter">'</span><span class="synString">1</span><span class="synDelimiter">'</span><span class="synOperator">,</span>  <span class="synDelimiter">'</span><span class="synString">2</span><span class="synDelimiter">'</span><span class="synOperator">,</span>   <span class="synDelimiter">'</span><span class="synString">3</span><span class="synDelimiter">'</span><span class="synOperator">,</span>   <span class="synDelimiter">'</span><span class="synString">4</span><span class="synDelimiter">'</span>   ])<span class="synOperator">,</span>
   <span class="synDelimiter">'</span><span class="synString">23</span><span class="synDelimiter">'</span><span class="synOperator">,</span>
   <span class="synDelimiter">'</span><span class="synString">longest token still holds, even between constant strings and regexes</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>

<span class="synKeyword">method</span> info { <span class="synOperator">[~]</span> <span class="synDelimiter">'</span><span class="synString"> -- </span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synIdentifier">$</span><span class="synSpecial">.</span><span class="synIdentifier">name</span><span class="synOperator">,</span>
                    (<span class="synDelimiter">'</span><span class="synString"> [</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synIdentifier">@</span><span class="synSpecial">.</span><span class="synIdentifier">vars</span><span class="synOperator">»</span><span class="synDelimiter">&lt;</span><span class="synString">name</span><span class="synDelimiter">&gt;</span><span class="synOperator">.</span>join(<span class="synDelimiter">'</span><span class="synString">, </span><span class="synDelimiter">'</span>)<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">]</span><span class="synDelimiter">'</span> <span class="synConditional">if</span> <span class="synIdentifier">@</span><span class="synSpecial">.</span><span class="synIdentifier">vars</span>) }

<span class="synDelimiter">s[</span><span class="synString">foo</span><span class="synDelimiter">][</span><span class="synString">bar </span><span class="synIdentifier">$baz</span><span class="synDelimiter">]</span>
<span class="synDelimiter">tr|</span><span class="synString">a</span><span class="synSpecialChar">..</span><span class="synString">c</span><span class="synDelimiter">|</span><span class="synString">A</span><span class="synSpecialChar">..</span><span class="synString">C</span><span class="synDelimiter">|</span><span class="synOperator">;</span>
<span class="synIdentifier">$japh</span> <span class="synOperator">~~</span> <span class="synDelimiter">tr[</span><span class="synString">a</span><span class="synSpecialChar">..</span><span class="synString">zA</span><span class="synSpecialChar">..</span><span class="synString">Z</span><span class="synDelimiter">][</span><span class="synString">n</span><span class="synSpecialChar">..</span><span class="synString">za</span><span class="synSpecialChar">..</span><span class="synString">mN</span><span class="synSpecialChar">..</span><span class="synString">ZA</span><span class="synSpecialChar">..</span><span class="synString">M</span><span class="synDelimiter">]</span><span class="synOperator">;</span>
<span class="synDelimiter">tr/</span><span class="synString">$123</span><span class="synDelimiter">/</span><span class="synString">X</span><span class="synSpecial">\x</span><span class="synSpecialChar">20</span><span class="synSpecial">\o</span><span class="synSpecialChar">40</span><span class="synSpecial">\t</span><span class="synDelimiter">/</span><span class="synOperator">;</span>

ok(<span class="synDelimiter">&quot;</span><span class="synString">  a b</span><span class="synSpecial">\t</span><span class="synString">c</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synIdentifier">@</span><span class="synSpecial">&lt;</span><span class="synIdentifier">chars</span><span class="synSpecial">&gt;</span><span class="synSpecialChar">=</span><span class="synSpecial">(</span><span class="synString"> </span><span class="synSpecial">\s</span><span class="synSpecialChar">+</span><span class="synString"> </span><span class="synSpecial">\S</span><span class="synSpecialChar">+</span><span class="synString"> </span><span class="synSpecial">)</span><span class="synSpecialChar">+</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Named simple array capture</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>
ok(<span class="synDelimiter">&quot;</span><span class="synString">abcxyd</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synString">a  </span><span class="synIdentifier">@</span><span class="synSpecial">&lt;</span><span class="synIdentifier">foo</span><span class="synSpecial">&gt;</span><span class="synSpecialChar">=</span><span class="synSpecial">(</span><span class="synSpecialChar">.</span><span class="synSpecial">(</span><span class="synSpecialChar">.</span><span class="synSpecial">))</span><span class="synSpecialChar">+</span><span class="synString"> d</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Repeated hypothetical array capture</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>
ok(<span class="synDelimiter">&quot;</span><span class="synString">  a b</span><span class="synSpecial">\t</span><span class="synString">c</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synIdentifier">@</span><span class="synSpecial">&lt;</span><span class="synIdentifier">chars</span><span class="synSpecial">&gt;</span><span class="synSpecialChar">=</span><span class="synSpecial">[</span> <span class="synSpecial">(&lt;?</span>spaces<span class="synSpecial">&gt;)</span> <span class="synSpecial">(\S</span><span class="synSpecialChar">+</span><span class="synSpecial">)]</span><span class="synSpecialChar">+</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Nested multiple array capture</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>

isa_ok(<span class="synKeyword">regex</span> {<span class="synString">oo</span>}<span class="synOperator">,</span> <span class="synType">Regex</span>)<span class="synOperator">;</span>
isa_ok(<span class="synDelimiter">rx</span> <span class="synDelimiter">(</span><span class="synString">o</span><span class="synDelimiter">)</span><span class="synOperator">,</span> <span class="synType">Regex</span>)
<span class="synSpecial">my</span> <span class="synIdentifier">@delims</span> <span class="synOperator">=</span> <span class="synDelimiter">&lt;</span><span class="synString"> ^ ° ! &quot; § $ % @ € &amp; / = ? ` * + ~ ; , . | </span><span class="synDelimiter">&gt;</span><span class="synOperator">;</span>

<span class="synSpecial">my</span> <span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">/</span><span class="synString">foobar</span><span class="synDelimiter">/</span><span class="synOperator">;</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">/=</span> <span class="synNumber">4</span><span class="synOperator">;</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">//</span> <span class="synIdentifier">$bar</span><span class="synOperator">;</span>
(<span class="synNumber">1</span><span class="synOperator">,</span><span class="synNumber">2</span>)[<span class="synOperator">*/</span><span class="synNumber">2</span>]<span class="synOperator">;</span>
<span class="synRepeat">while</span> <span class="synDelimiter">/</span><span class="synString">foobar</span><span class="synDelimiter">/</span> {
}
<span class="synIdentifier">$a</span> <span class="synOperator">=</span> <span class="synIdentifier">$bla</span> <span class="synOperator">/</span> <span class="synNumber">5</span><span class="synOperator">;</span>

<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">m«</span><span class="synString">sdfdfsdf</span><span class="synDelimiter">»</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">s/</span><span class="synString">foo</span><span class="synDelimiter">/</span><span class="synIdentifier">$bar</span><span class="synDelimiter">/</span><span class="synOperator">;</span>

<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synString">sd</span><span class="synSpecialChar">$</span><span class="synDelimiter">/</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">s/</span><span class="synString">sd</span><span class="synSpecialChar">$</span><span class="synDelimiter">/</span><span class="synString">foo</span><span class="synIdentifier">$bar</span><span class="synDelimiter">/</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">s{</span><span class="synString">sdfsdf</span><span class="synDelimiter">}</span>
<span class="synIdentifier">$foo</span> <span class="synOperator">~~</span> <span class="synDelimiter">tr/</span><span class="synString">dsf</span><span class="synDelimiter">/</span><span class="synString">sdf</span><span class="synDelimiter">/</span>

<span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">bar</span><span class="synSpecial">&gt;</span>
<span class="synType">Order::Same</span>
<span class="synType">Bool::True</span>
<span class="synDelimiter">/</span><span class="synString">sdfdsf</span><span class="synDelimiter">/</span>
<span class="synRepeat">given</span> <span class="synIdentifier">$foo</span> {
    <span class="synSpecial">when</span> <span class="synDelimiter">/</span><span class="synString">dsfsdf</span><span class="synDelimiter">/</span> {
    }
}
foo::bar <span class="synOperator">/</span> <span class="synNumber">4</span><span class="synOperator">;</span>
<span class="synRepeat">while</span> <span class="synDelimiter">/</span><span class="synString">foo</span><span class="synDelimiter">/</span><span class="synOperator">;</span>
say <span class="synIdentifier">@foo</span><span class="synOperator">.</span>grep<span class="synOperator">:</span> <span class="synDelimiter">/</span><span class="synString">dsfsdf</span><span class="synDelimiter">/</span>
say <span class="synIdentifier">@foo</span><span class="synOperator">.</span>grep(<span class="synDelimiter">/</span><span class="synString">dsfsdf</span><span class="synDelimiter">/</span>)
<span class="synIdentifier">$bla</span> <span class="synOperator">/</span> <span class="synNumber">3</span><span class="synOperator">;</span>

<span class="synNumber">Inf</span>
<span class="synNumber">-Inf</span>
<span class="synNumber">+Inf</span>
<span class="synNumber">NaN</span>
<span class="synOperator">-</span><span class="synNumber">NaN</span>
<span class="synNumber">-3.340404</span>
<span class="synNumber">0.3</span>
<span class="synNumber">.3</span>
<span class="synNumber">100_000</span>
<span class="synNumber">1.2e7_000</span>
<span class="synNumber">1.2e-7</span>

<span class="synKeyword">token</span> foo {
<span class="synString">    </span><span class="synSpecial">&lt;*</span> <span class="synSpecial">&lt; </span><span class="synString">foo bar</span><span class="synSpecial"> &gt;</span> <span class="synSpecial">&gt;</span>
}
<span class="synInclude">use</span> <span class="synSpecial">v6.0.0</span><span class="synOperator">;</span>
<span class="synInclude">use</span> Test<span class="synOperator">;</span>
say <span class="synDelimiter">&quot;</span><span class="synString">foo bar</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>
<span class="synIdentifier">@foo</span><span class="synOperator">.</span>push<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">bar</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

<span class="synOperator">-</span> <span class="synNumber">0</span><span class="synSpecial">o</span><span class="synNumber">500</span>
<span class="synNumber">-0</span><span class="synSpecial">o</span><span class="synNumber">500</span>
<span class="synNumber">-0</span><span class="synSpecial">x</span><span class="synNumber">500</span>
<span class="synNumber">0</span><span class="synSpecial">d</span><span class="synNumber">500</span>

<span class="synLabel">LABEL:</span> <span class="synRepeat">for</span> <span class="synNumber">0</span><span class="synOperator">..</span><span class="synIdentifier">$string</span><span class="synOperator">.</span>chars<span class="synOperator">-</span><span class="synNumber">1</span> <span class="synOperator">-&gt;</span> <span class="synIdentifier">$pos</span> {
}

<span class="synIdentifier">$sum</span> <span class="synOperator">+=</span> <span class="synIdentifier">$num</span> <span class="synConditional">if</span> <span class="synIdentifier">$num</span><span class="synOperator">.</span>is-prime<span class="synOperator">;</span>

<span class="synKeyword">sub</span> if'a(<span class="synIdentifier">$x</span>) {<span class="synIdentifier">$x</span>}
is if'a(<span class="synNumber">5</span>)<span class="synOperator">,</span> <span class="synNumber">5</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">if'a is a valid sub name</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

ok (<span class="synSpecial">my</span> <span class="synIdentifier">%</span> <span class="synOperator">=</span> <span class="synString">baz</span> <span class="synOperator">=&gt;</span> <span class="synDelimiter">&quot;</span><span class="synString">luhrman</span><span class="synDelimiter">&quot;</span>)<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">initialized bare sigil hash %</span><span class="synDelimiter">'</span><span class="synOperator">;</span>
<span class="synConditional">if</span> (<span class="synIdentifier">$foo</span> <span class="synOperator">%</span> <span class="synNumber">3</span> <span class="synOperator">==</span> <span class="synNumber">0</span>) {
}

<span class="synSpecial">my</span> <span class="synIdentifier">$f</span> <span class="synOperator">=</span> <span class="synOperator">*</span> <span class="synOperator">!&lt;</span> <span class="synNumber">3</span><span class="synOperator">;</span>
isa_ok <span class="synIdentifier">$f</span><span class="synOperator">,</span> <span class="synType">Code</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Whatever-currying !&lt; (1)</span><span class="synDelimiter">'</span><span class="synOperator">;</span>

<span class="synSpecial">my</span> <span class="synIdentifier">$quote</span> <span class="synOperator">=</span> <span class="synDelimiter">q//</span><span class="synOperator">;</span>
<span class="synSpecial">my</span> <span class="synIdentifier">$call</span> <span class="synOperator">=</span> q()<span class="synOperator">;</span>

<span class="synIdentifier">@data</span> <span class="synOperator">==&gt;</span> grep {<span class="synDelimiter">/</span><span class="synSpecial">&lt;[</span><span class="synString">aeiouy</span><span class="synSpecial">]&gt;</span><span class="synDelimiter">/</span>} <span class="synOperator">==&gt;</span> <span class="synPreCondit">is</span>(<span class="synOperator">$</span>(<span class="synOperator">*</span>)<span class="synOperator">,</span> <span class="synOperator">$</span>(<span class="synIdentifier">@out</span>)<span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">basic test for $(*)</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>

<span class="synKeyword">sub</span> is-cool {
}

<span class="synKeyword">sub</span> q {
}

<span class="synStatement">=begin</span> <span class="synType">foo-bar</span>

<span class="synComment">bla</span>

<span class="synStatement">=end</span> <span class="synType">foo-bar</span>

<span class="synIdentifier">@foo</span><span class="synOperator">».++;</span>

<span class="synIdentifier">$foo</span><span class="synOperator">.^</span>method

say <span class="synType">Buf</span><span class="synOperator">.</span>new(<span class="synOperator">+«</span><span class="synDelimiter">&quot;</span><span class="synString">127.0.0.1</span><span class="synDelimiter">&quot;</span><span class="synOperator">.</span>split(<span class="synDelimiter">&quot;</span><span class="synString">.</span><span class="synDelimiter">&quot;</span>))<span class="synOperator">.</span>unpack(<span class="synDelimiter">&quot;</span><span class="synString">N</span><span class="synDelimiter">&quot;</span>)

<span class="synOperator">[&amp;sprintf]</span>
<span class="synOperator">X[&amp;sprintf]</span>
<span class="synIdentifier">$foo</span><span class="synOperator">,</span> <span class="synIdentifier">$</span><span class="synOperator">,</span> <span class="synIdentifier">$bar</span> <span class="synOperator">=</span> <span class="synIdentifier">@bla</span><span class="synOperator">;</span>
<span class="synIdentifier">$foo</span><span class="synOperator">,</span> <span class="synIdentifier">@</span><span class="synOperator">,</span> <span class="synIdentifier">$bar</span> <span class="synOperator">=</span> <span class="synIdentifier">@bla</span><span class="synOperator">;</span>

isa_ok <span class="synNumber">NaN</span> <span class="synOperator">+</span> <span class="synNumber">1i</span><span class="synOperator">,</span> <span class="synType">Complex</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">NaN + 1i is a Complex number</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>
ok <span class="synNumber">NaN</span> <span class="synOperator">+</span> <span class="synNumber">1i</span> <span class="synOperator">~~</span> <span class="synNumber">NaN</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">NaN + 1i ~~ NaN</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>
ok <span class="synNumber">NaN</span> <span class="synOperator">~~</span> <span class="synNumber">NaN</span> <span class="synOperator">+</span> <span class="synNumber">1i</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">NaN ~~ NaN + 1i</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

<span class="synSpecial">my</span> <span class="synIdentifier">$str</span> <span class="synOperator">=</span> <span class="synDelimiter">&quot;</span><span class="synString">bla bla </span><span class="synIdentifier">&amp;is-cool</span>()<span class="synString"> yes</span><span class="synDelimiter">&quot;</span><span class="synOperator">;</span>

<span class="synKeyword">class</span> Foo-Bar {
    <span class="synKeyword">method</span> bla { say <span class="synDelimiter">&quot;</span><span class="synString">foo</span><span class="synDelimiter">&quot;</span> }
}

<span class="synKeyword">class</span> Bla'Bla {
    <span class="synKeyword">method</span> boo { say <span class="synDelimiter">&quot;</span><span class="synString">bar</span><span class="synDelimiter">&quot;</span> }
}

<span class="synNumber">Inf</span><span class="synOperator">,</span> <span class="synNumber">-Inf</span><span class="synOperator">,</span> <span class="synNumber">NaN</span><span class="synOperator">,</span> <span class="synNumber">+Inf</span>

<span class="synComment"># old-style octals are bad</span>
<span class="synDelimiter">&quot;</span><span class="synError">\10</span><span class="synDelimiter">&quot;</span>
<span class="synDelimiter">&quot;</span><span class="synError">\123</span><span class="synDelimiter">&quot;</span>
<span class="synComment"># ascii nul is ok though</span>
<span class="synDelimiter">&quot;</span><span class="synSpecial">\0</span><span class="synString">40</span><span class="synDelimiter">&quot;</span>

<span class="synRepeat">for</span> (<span class="synDelimiter">'</span><span class="synString">/foo/bar/baz/</span><span class="synDelimiter">'</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synSpecialChar">^</span><span class="synString"> </span><span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">dirname</span><span class="synSpecial">&gt;</span><span class="synSpecialChar">=</span><span class="synSpecial">(</span><span class="synSpecialChar">.*</span><span class="synString"> </span><span class="synDelimiter">'</span><span class="synString">/</span><span class="synDelimiter">'</span><span class="synSpecialChar">+</span><span class="synSpecial">)</span><span class="synSpecialChar">?</span><span class="synString"> </span><span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">basename</span><span class="synSpecial">&gt;</span><span class="synSpecialChar">=</span><span class="synSpecial">(&lt;</span><span class="synSpecialChar">-</span><span class="synSpecial">[\/]&gt;</span><span class="synSpecialChar">+</span><span class="synSpecial">)</span><span class="synString"> </span><span class="synDelimiter">'</span><span class="synString">/</span><span class="synDelimiter">'</span><span class="synSpecialChar">*</span><span class="synString"> </span><span class="synSpecialChar">$</span><span class="synString"> </span><span class="synDelimiter">/</span>)<span class="synOperator">.</span>gist<span class="synOperator">.</span>lines {
    <span class="synIdentifier">%count</span>{<span class="synIdentifier">$0</span>}<span class="synOperator">++</span> <span class="synConditional">if</span> <span class="synDelimiter">/</span><span class="synString"> </span><span class="synSpecialChar">^</span><span class="synString"> </span><span class="synSpecial">\s</span><span class="synSpecialChar">+</span><span class="synString"> </span><span class="synSpecial">(\w</span><span class="synSpecialChar">+</span><span class="synSpecial">)</span><span class="synString"> </span><span class="synSpecial">\s</span><span class="synSpecialChar">+</span><span class="synString"> </span><span class="synDelimiter">'</span><span class="synString">=&gt;</span><span class="synDelimiter">'</span><span class="synString"> </span><span class="synDelimiter">/</span><span class="synOperator">;</span>   <span class="synComment">## extract key</span>
}<span class="synOperator">;</span>
throws_like <span class="synDelimiter">&quot;</span><span class="synString">my Int a = 10;</span><span class="synDelimiter">&quot;</span><span class="synOperator">,</span> X::Syntax::Malformed<span class="synOperator">,</span> <span class="synString">message</span> <span class="synOperator">=&gt;</span> <span class="synDelimiter">/</span><span class="synString"> sigilless </span><span class="synDelimiter">/</span><span class="synOperator">;</span>

my()
BEGIN()

<span class="synComment"># vim: ft=perl6</span>
</pre>

 </body>
</html>
